#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    tch = new Teacher(this);
    stu = new Student(this);

    QPushButton* btn = new QPushButton(this);
    connect(btn, &QPushButton::clicked, stu, &Student::startStudy);
    connect(tch, &Teacher::MySignal, stu, &Student::startStudy);

    resize(800,600);
    btn->move(200,300);
    EmitSignal();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::EmitSignal()
{
    emit tch->MySignal();
}

